Computer systems include computer hardware, such as one or more processors and one or more storage devices, and software entities made up of instructions for causing the processors to perform one or more related tasks. Limits on the amount of resources in the computer system have impacts on the software systems executing on the hardware to perform the related tasks. For example, the amount of memory limits how much data a processor can access quickly; the amount of durable storage limits the amount of data that can be stored in a database; and the communications bandwidth limits the number and size of messages that can be exchanged with other devices connected to the computer.
One way that limited resources can be employed by computer systems to perform more, larger and more complex tasks, is to reuse some resources when possible. For example, a large amount of sort space in memory facilitates sorting a large number of results from a query of a large database, but the space in memory is free after the sort is completed and can be used to perform a second sort. The sort space in memory is an example of a reusable resource. Cache space in memory for temporarily holding data from several blocks of a storage medium is another example of a reusable resource. Another example of a reusable resource is communications bandwidth. A large amount of bandwidth is consumed to send a video clip or audio track, but the same bandwidth is available to send another message, clip or track after the first clip or track is transmitted.
Durable storage is typically consumed by a computer system for relatively permanent uses, such as storing data and software. Durable storage is often not a reusable resource for a computer system; typically, as more data are stored, more durable storage is consumed. However, an example in which durable storage is reusable is the durable storage of undo information. Some entities of the computer system include transactions that make changes to the computer system, such as changing the data stored in a database or changing the state of equipment controlled by the computer system. These transactions might involve hundreds or millions of operations and take minutes or hours to complete. If a transaction does not complete successfully, then the data in the database or the equipment is in some interim state that is not planned and that is probably not desired. It is therefore conventional for the transaction to generate and store in an undo storage space an undo log of data indicating operations to perform to reverse the operations performed during the transaction.
If the transaction fails to complete successfully, the changes to the computer system are undone, following the operations in the undo log from last to first. The undo operations restore the computer system to a state before the transaction began, a state that was planned, at least at one point in time, and that is preferable to the unplanned interim state. The durable storage employed to store the undo log is a reusable resource. After the transaction completes, or after the unsuccessful transaction is undone, the undo data in the storage is considered obsolete and the storage allocated to the undo data is re-allocated to another transaction.
Conventional systems for managing resources reused by multiple entities often prompt an administrator for the computer system to partition the resource into segments that manage a limited number of entities at a time. Several segments of different sizes, to manage different amounts of the reusable resource, are defined by the administrator. Entities that use a large amount of the reusable resource should request the larger segments. Entities that use a small amount should request the smaller segments. Enough segments should be generated to avoid too many entities using the same segment. Too many entities using the same segment cause the system performance to degrade. Segments should be large enough to provide all the reusable resource requested by an entity. If a segment is not large enough, the entity is unable to continue executing and an error may result. Thus, the users of the computer system are penalized with poor performance and errors if the partitioning does not accommodate actual usage. These penalties often motivate the administrators to specify too many segments and to specify segment sizes that are too large, thus devoting too many of the computer system resources to the reusable resource.
For example, in a conventional database system, the administrator is prompted to partition the undo storage space by specifying a number of undo segments and specifying the amount of space in each. The administrator is requested to estimate the maximum number of concurrent transactions. If the estimate is too low, and more transactions execute concurrently than were specified by the administrator, some transactions may fail. The administrator is also prompted to provide the average number of transactions to manage in each segment to minimize contention. The administrator may have no basis to make this estimate and resort to an industry standard that is not optimal for the use made by the particular database. The administrator is prompted for the number of segments. If not enough segments are specified, some segments may become congested with too many transactions and the performance of the system degrades. For the longest running transactions performed by the system to succeed, the administrator should specify at least one segment big enough to handle the transaction, and, at runtime, the user should explicitly assign the transaction to the big segment. Such coordination is often very difficult and thus impractical to achieve. The users of the database system are penalized if the partitioning does not match the actual use of the undo storage space.
Clearly, there is a need for techniques that allow a resource to be recycled and allocated for new uses by other entities in a computer system, but that do not burden a human administrator with partitioning the resource and then punish the administrator and users by generating errors when the partitions do not match usage.